<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<!DOCTYPE html>

<html>
<head>
	<meta charset="utf-8" />
	<title>사용자등록</title>
	<link rel="Stylesheet" href="/demoweb/styles/default.css" />
	<link rel="Stylesheet" href="/demoweb/styles/input.css" />
	<script type="text/javascript">
	function checkAndSubmit() {
		var message = "";
		var memberId = document.getElementById("memberId");
		if (memberId.value.length == 0) {
			message += "아이디를 입력하세요.\r\n";
		}
		/* var regExp = new RegExp("/^[0-9A-Za-z]{5,20}$");
		if(!regExp.test(memberId)) {
			message += (memberId + "아이디 형식 오류(영문자,숫자 조합 5~ 20개)\r\n");
		} */ 
		
		var passwd = document.getElementById("passwd");
		if (passwd.value.length == 0) {
			message += "비밀번호를 입력하세요.\r\n";
		}
		
		var confirm = document.getElementById("confirm");
		if (confirm.value != passwd.value) {
			message += "비밀번호 불일치.\r\n";
		}
		
		if (message.length > 0) {
			alert(message);
		} else {
			document.getElementById("registerform").submit();
		}
	}
	</script>
</head>
<body>

	<div id="pageContainer">
		<div id="inputcontent">
			<br /><br />
		    <div id="inputmain">
		        <div class="inputsubtitle">회원기본정보</div>

		        <form id="registerform" action="regist.action" method="post"><!-- 상대경로표시 -->
		        <table>
		            <tr>
		                <th>아이디(ID)</th>
		                <td>
		                    <input type="text" id="memberId" name="memberId" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>비밀번호</th>
		                <td>
		                	<input type="password" id="passwd" name="passwd" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>비밀번호 확인</th>
		                <td>
		                    <input type="password" id="confirm" name="confirm" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>이름</th>
		                <td>
		                	<input type="text" name="name" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>이메일</th>
		                <td>
		                	<input type="text" name="email" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>주소</th>
		                <td>
							<input type="text" name="address" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>주민등록번호</th>
		                <td>
		                	<input type="text" name="regNum" style="width:280px" />
		                </td>
		            </tr>		            		            
		        </table>
		        <div class="buttons">
		        	<input type="button" value="등록" style="height:25px" onclick="checkAndSubmit();" />
		        	<input type="button" value="취소" style="height:25px"
		        		onclick="location.href='list.action';" />

		        </div>
		        </form>
		    </div>
		</div>   	
	
	</div>
</body>
</html>